package com.example.demo.project; /**
 * 编辑人：王其
 */

import java.util.Scanner;

public class BankSystem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入存款人姓名、账号、存款类型（活期或定期）、存款金额、存款期限（定期存款时输入，单位：月）：");
        String ownerName = scanner.next();
        String accountNumber = scanner.next();
        String depositType = scanner.next();
        double amount = scanner.nextDouble();
        int term = scanner.nextInt();
        BankService bankService = new BankService(accountNumber, ownerName);
        bankService.createDeposit(depositType, amount, term);
        bankService.displayAccountInfo();
        System.out.println("是否需要取款？(yes/no)");
        String withdrawal = scanner.next();
        if ("yes".equalsIgnoreCase(withdrawal)) {
            bankService.withdraw();
        }
        scanner.close();
    }
}